﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FUSE;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace FUSE
{
    public abstract class MassedComponent : FUSE.GalaxyComponent
    {
        private Circle crashCircle;
        protected Circle slingCircle;
        
        private int mass;
        protected int points;         //the number of points recieved for a successful orbit of the planet (also used to determine slingshot points)

 
        public MassedComponent() : base()
        {
            this.slingCircle = new Circle();
            this.crashCircle = new Circle();
            this.mass = 1;
            
        }

        public MassedComponent(int mass) : base()
        {
            
            this.slingCircle = new Circle();
            this.crashCircle = new Circle();
            this.mass = mass;
        }

        public override void Initialize()
        {
            mass = 1;

            base.Initialize();

            crashCircle.centerPOS = ComponentBounds.centerPOS;
            slingCircle.centerPOS = ComponentBounds.centerPOS;
        }

        public override void LoadContent(Texture2D texture)
        {
            base.LoadContent(texture);

            crashCircle.radius = ComponentBounds.radius + (ComponentBounds.radius * 0.30f);
            slingCircle.radius = ComponentBounds.radius * 3.7f;
        }

        public override void SetRenderPosition(float xCoord, float yCoord)
        {
            base.SetRenderPosition(xCoord, yCoord);

            crashCircle.SetPosition(ComponentBounds.centerPOS);
            slingCircle.SetPosition(ComponentBounds.centerPOS);
        }

        public override void SetCenterPosition(float xCoord, float yCoord)
        {
            base.SetCenterPosition(xCoord, yCoord);

            crashCircle.SetPosition(ComponentBounds.centerPOS);
            slingCircle.SetPosition(ComponentBounds.centerPOS);
        }
             

        public Circle CrashCircle
        {


            get { return crashCircle; }
        }

        public Circle SlingCircle
        {
            get { return slingCircle; }
        }

        public int Mass
        {
            get { return mass; }
            set { mass = value; }
        }
        public int Points
        {
            get { return points; }
            set { points = value; }
        }
    }

}
